{% extends 'basic.html' %}
{% block title %}缓存清理{% endblock %}
{% block content %}
    <link href="{{  url_for('static',filename='main/css/sweetalert.css') }}" rel="stylesheet" type="text/css" />
    <script src="{{  url_for('static',filename='main/js/sweetalert.min.js') }}"></script>
    <aside class="right-side" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">

 <section class="col-lg-12 connectedSortable ui-sortable">

            <div class="king-page-box">
        <div class="king-container clearfix">
            <div class="container-fluid mb0 ">
                <div class="row">
                    <div class="col-md-12"></div>
                    <div class="col-md-12">
                        <div class="panel panel-success mb0">
                            <div class="panel-heading"> 缓存清理 </div>
                            <div class="panel-body">
                                <form class="form-horizontal">
                                    <div class="form-group clearfix">
                                        <div class="col-sm-9 col-sm-offset-3">
                                            <div class="pull-left info">
                                           
                                            <input type="button" class="king-btn mr10  king-success" onclick="clean_cache()" value="提交" />
                                        
                                        </div>
                                    </div>
                                        </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4"></div>
                </div>
            </div>
        </div>
    </div>
    </section>
    </aside>


    <script>
        function clean_cache() {
        
            $.ajax ({
                type:'POST',
                //contentType: 'application/json; charset=UTF-8',
                dataType: 'json',
                url:"http://cbtops.moefantasy.org:8989/clean_cache/",
                 success: function(res) {
                     if (res.result) {
                        //layer.msg('success')
                        swal({
                          title: res.message,
                          timer: 1500,
                          imageUrl: "{{  url_for('static',filename='main/img/thumbs-up.jpg') }}",
                          showConfirmButton: false
                        });
                     }
                     else{
                         swal(res.message,'','error')
                     }
                    }
                });
        }
    </script>
{% endblock %}

